﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TextMenus.TestKit
{
    class TestMenu: TextMenu
    {
        private MenuOption PrintHelloOption;

        public TestMenu()
            : base(true)
        {
            InitializeInstance();
        }

        private void InitializeInstance()
        {
            BeforeMenuOptionChosen += BeforeOptionChosen;
            AfterMenuOptionChosen += AfterOptionChosen;
            PrintHelloOption = new MenuOption("Print Hello", PrintHello);
            AddMenuOption(PrintHelloOption);
        }

        private void BeforeOptionChosen(MenuInputInfo info)
        {
            output.WriteLine("An option was chosen: {0}", info.SelectedOption.Description);
        }

        private void AfterOptionChosen(MenuInputInfo info)
        {
            output.WriteLine("Finished with operations for the menu choice: {0}\n", info.SelectedOption.Description);
        }

        private void PrintHello(MenuInputInfo info)
        {
            output.WriteLine("Hello!");
        }
    }
}
